//
// Created by Administrator on 2023/7/29.
//
#include <iostream>
#include <unordered_set>

using namespace std;

class Solution {
public:
    char repeatedCharacter(string s) {
        unordered_set<char> us;
        for (auto &x: s) {
            if (us.count(x)) return x;
            else us.insert(x);
        }
        return ' ';
    }
};


int main() {
    Solution s;
    cout << s.repeatedCharacter("abccbaacz") << endl;
    cout << s.repeatedCharacter("abcdd") << endl;
}